from api.ihrm_api import IHRMApi
from common.token_util import TokenUtil


class UserUtil:

    @classmethod
    def get_user_id(cls):
        # 1 直接从数据库里面查询一个员工id(代码方式)
        # 2 调用接口方式
        token = TokenUtil.get_ihrm_token()
        body = {
            "username": "小猪佩奇",
            "mobile": "15912882115",
            "workNumber": "22"
        }

        resp = IHRMApi.add_user_api(token, body)
        user_id = resp.json().get("data").get("id")
        return user_id
        pass

    pass
if __name__ == '__main__':
    print(UserUtil.get_user_id())
